/*
 * main.cpp
 *
 *  Created on: Nov 22, 2009
 *      Author: abhishek
 */
#include "PageRank.h"
#include "Reprice.h"
#include "carts.h"

using namespace std ;


void pageRank(){
		PageRank* p = new PageRank();
		p->loadData();
		p->computePageRank();
}

void reprice(){

	Reprice* r = new Reprice();
	r->readGraph();
//	r->heuristic1();
	r->heuristic2();
//	r->heuristic3();
}

void generateRandomPrice(){

	srand ( time(NULL) );

	ofstream myfile;
	myfile.open(PRICEFILENAME);

	for (int i = 0 ; i < NUMNODES ; i++){
		int price_ = rand() % PRICERANGE + 1;
		myfile << i << "\t" << price_ << endl ;
	}
	myfile.close();

}


void generateInfluence(){

	srand ( time(NULL) );

	ofstream myfile;
	myfile.open(INFLUENCEFILENAME);

	for (int i = 0 ; i < NUMNODES ; i++){
//		int price_ = rand() % PRICERANGE + 1;
		float randomNumber = (float) rand()/RAND_MAX ;

		randomNumber *= 2.000 ;
		myfile << i << "\t" << randomNumber << endl ;
	}
	myfile.close();

}

int main(){

//	pageRank();

	generateRandomPrice();
//	reprice();
	generateInfluence();

	Carts* cart = new Carts();
	cart->startCarts();


	return 1 ;
}
